package com.example.supernote.model.note.commandGroups

import com.example.supernote.R
import com.example.supernote.model.note.commands.AbstractCommand
import com.example.supernote.model.note.commands.Insert.GenerateCodeCommand
import com.example.supernote.model.note.commands.Insert.GenerateImageCommand
import com.example.supernote.model.note.commands.Insert.InsertCodeCommand
import com.example.supernote.model.note.commands.Insert.InsertLineCodeCommand
import com.example.supernote.model.note.commands.Insert.InsertLineCommand
import com.example.supernote.model.note.commands.Insert.InsertLinkCommand
import com.example.supernote.model.note.commands.Insert.InsertMathCommand
import com.example.supernote.model.note.commands.Insert.InsertQuoteCommand
import com.example.supernote.model.note.commands.Insert.OcrAudioCommand
import com.example.supernote.model.note.commands.Insert.OcrImageCommand
import com.example.supernote.model.note.commands.Insert.UploadAudioCommand
import com.example.supernote.model.note.commands.Insert.UploadImageCommand
import com.example.supernote.model.note.commands.Insert.UploadVideoCommand
import com.example.supernote.model.note.commands.Layout.AlignCenterCommand
import com.example.supernote.model.note.commands.Layout.AlignLeftCommand
import com.example.supernote.model.note.commands.Layout.AlignRightCommand
import com.example.supernote.model.note.commands.Layout.InsertTableCommand
import com.example.supernote.model.note.commands.Layout.ListCommand
import com.example.supernote.model.note.commands.More.AlarmCommand
import com.example.supernote.model.note.commands.More.ExportCommand
import com.example.supernote.model.note.commands.More.SaveCommand
import com.example.supernote.model.note.commands.More.ShareCommand
import com.example.supernote.model.note.commands.Text.BoldCommand
import com.example.supernote.model.note.commands.Text.DeleteLineCommand
import com.example.supernote.model.note.commands.Text.ExtractOutlineCommand
import com.example.supernote.model.note.commands.Text.ExtractSummaryCommand
import com.example.supernote.model.note.commands.Text.FontColorCommand
import com.example.supernote.model.note.commands.Text.FontSizeCommand
import com.example.supernote.model.note.commands.Text.H1Command
import com.example.supernote.model.note.commands.Text.H2Command
import com.example.supernote.model.note.commands.Text.H3Command
import com.example.supernote.model.note.commands.Text.H4Command
import com.example.supernote.model.note.commands.Text.H5Command
import com.example.supernote.model.note.commands.Text.H6Command
import com.example.supernote.model.note.commands.Text.ItalicCommand
import com.example.supernote.model.note.commands.Text.PolishTextCommand
import com.example.supernote.model.note.commands.Text.TextGenerateCommand
import com.example.supernote.model.note.commands.Text.TranslateTextCommand
import com.example.supernote.model.note.commands.Text.UnderLineCommand


// 文本部分
class HeadersCommandGroup : AbstractCommandGroup(R.string.note_article_title) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            H1Command(),
            H2Command(),
            H3Command(),
            H4Command(),
            H5Command(),
            H6Command()
        )
}

class FontStylesCommandGroup : AbstractCommandGroup(R.string.note_font_style) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            BoldCommand(),
            ItalicCommand(),
            DeleteLineCommand(),
            UnderLineCommand(),
            FontColorCommand(),
            FontSizeCommand()
        )
}

class AiDealCommandGroup : AbstractCommandGroup(R.string.note_ai_plus) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            ExtractOutlineCommand(),
            ExtractSummaryCommand(),
            PolishTextCommand(),
            TextGenerateCommand(),
            TranslateTextCommand()
        )
}


// 布局部分
class TableCommandGroup : AbstractCommandGroup(R.string.note_list) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            ListCommand(),
            InsertTableCommand()
        )
}

class PositionCommandGroup : AbstractCommandGroup(R.string.note_align) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            AlignLeftCommand(),
            AlignCenterCommand(),
            AlignRightCommand()
        )
}

// 插入部分
class GeneralCommandGroup : AbstractCommandGroup(R.string.note_general) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            InsertQuoteCommand(),
            InsertLineCommand(),
            InsertLinkCommand(),
            InsertMathCommand()
        )
}

class CodeCommandGroup : AbstractCommandGroup(R.string.note_code) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            InsertLineCodeCommand(),
            InsertCodeCommand(),
            GenerateCodeCommand()
        )
}

class ImageCommandGroup : AbstractCommandGroup(R.string.note_image) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            UploadImageCommand(),
            GenerateImageCommand(),
            OcrImageCommand()
        )
}

class VoiceCommandGroup : AbstractCommandGroup(R.string.note_video) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            UploadAudioCommand(),
            OcrAudioCommand()
        )
}

class VideoCommandGroup : AbstractCommandGroup(R.string.note_media) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            UploadVideoCommand()
        )
}

// 更多部分
class MoreCommandGroup : AbstractCommandGroup(R.string.note_more) {
    override fun getCommands(): MutableList<AbstractCommand> =
        mutableListOf(
            SaveCommand(),
            ExportCommand(),
            AlarmCommand(),
            ShareCommand()
        )
}
